package edu.njust.service;

import edu.njust.pojo.*;
import org.apache.ibatis.annotations.Param;

import java.sql.Date;
import java.sql.Time;
import java.util.List;

public interface CourseService {

//    //√
//    //通过学生学号获取课程列表
//    List<Reservation> getReservationListById(String id);
//
//    //√
//    //通过学生学号以及日期获取当天课程列表
//    List<Reservation> getReservationListByIdAndDate(String id, Date date);
//
//    //√
//    //通过学生学号、日期以及第几大节课获取该时间段课表
//    List<Reservation> getReservationListByIdAndDateAndTimeNum(String id, Date date, Integer time_num);

    //-----------------------学生---------------------------------------------------------------------------------------
    //√
    // 1 学生查询需要进行（可选）的实验课
    List<ReservationItem> searchExistingKlassReservationForStudent(String student_id);

    //√
    // 2 学生查询需要进行的考试
    List<ReservationItem> searchOwnExamReservationForStudent(String student_id);

    //√
    // 3 学生查询已选的实验课
    List<ReservationItem> getSelectedKlassReservation(String student_id);

    // 4 学生查询已有的比赛
    List<ReservationItem> getExistingCompetitionReservation(String student_id);

    //√
    // 5 学生选择实验课
    Integer selectKlassReservationForStudent(Long reservationItem_id,String student_id);

    //√
    // 6 学生退课
    Integer quitKlassReservationForStudent(Long reservationItem_id,String student_id);

    //-----------------------老师---------------------------------------------------------------------------------------

    //√
    // 7 通过老师Id查询自己的预约
    List<KlassReservation> getReservationListByTeacherId(String id);

    //√
    // 8 通过预约id取消预约
    Integer quitReservation(Long reservation_id,Integer reservation_type);

    //√
    //// 9 item取消
    Integer quitReservationItem(Long reservation_id);

    //√
    // 10 根据选课类型的需求返回可选的机房列表
    List<ComputerRoom> getComputerRoomListByType(Date date, Integer time_num,Integer reservation_type);

    /////√
    // 11 根据时间和序号显示该时间段机房信息
    List<ComputerRoom> getComputerRoomList(Date date, Integer time_num);

    //√
    // 12 通过老师id和课程名显示课程班级信息
    List<Klass> getKlassList(String teacher_id, String course_name);

    //√ss
    // 13 开放性实验排课
    void addLabReservation(String teacher_id, String course_name, Date begin_time, Date end_time,Integer plan_num);

    ///// 14 通过比赛时间获取time_num的列表
    List<Integer> getConflictedTimeNumByTime(Time begin_time,Time end_time);

    //获取 （比赛间） 有重复时间段的所有比赛
    List<CompetitionReservation> getConflictedCompetition(Date date ,Time begin_time,Time end_time);

    //******/// 15 根据安排的比赛时间返回会产生冲突的课/考试/比赛
    List<Reservation> getConflictedReservation(Date date, Time begin_time, Time end_time,List<String> computer_room_id);


    List<Reservation> getReservationListByItemList(List<ReservationItem> reservationItemList);

    // 16 添加比赛预约
    Integer addCompetitionReservation(String user_id, String Scheduling_name, Date date, Time begin_time, Time end_time,
                                             List<String> computer_room_id,List<String> student_id);

    //ToDo 通过老师id获取自己的课程
    List<Course> getCourseListForTeacher(String teacher_id);

    //ToDo 显示所有课程
    List<Course> getAllCourseForAdmin();

    //ToDo 通过老师name和课程名的关键字搜索课程
    List<Course> getCourseListByInformation(String teacher_name,String course_name);



    // 17 确认排课
    void addKlassReservation(String teacher_id, String course_name, String scheduling_name, Date date , Integer time_num,
                        boolean is_shared, Integer reservation_type, List<String> computer_room_id, List<String> klass_idList);

    // 18 确认安排考试
    void addExamReservation(String teacher_id, String course_name, String scheduling_name, Date date , Integer time_num,
                        Integer reservation_type, List<String> computer_room_id);

    ////// 19 ToDo 生成reservationItem
    void addReservationItem(Long Reservation_id,String reservation_name,List<ComputerRoom> computerRoomList,List<Klass> klassList,List<String>student_id_list,boolean is_shared,Integer type);


    // 20 通过实验名称、老师名字、日期查询课程 TODO todo todo ??
    List<Reservation> getReservationList(String scheduling_name, String teacher_name, String date);


    //√
    /////// 21 将课程列表和考试列表合并TODO
    public List<Reservation> mergeReservation(List<KlassReservation> klassReservations, List<ExamReservation> examReservations ,
                                              List<LabReservation> labReservations,List<CompetitionReservation> competitionReservations);

    // 22 显示所有机房安排 ??
    List<ReservationItem> getAllRoomReservation();

    // 23 显示所有课程实验安排 ??
    List<KlassReservation> getAllKlassReservation();

    // 24 显示所有考试安排 ？？
    List<ExamReservation> getAllExamReservation();


    // 25 显示所有比赛安排 ？？
    List<CompetitionReservation> getAllCompetitionReservation();

    //√
    // 26 通过日期、序号获得所有预约列表 ？？
    List<Reservation> getReservationListByDateAndTimeNum(Date date ,Integer time_num);

    //√
    // 27 显示当前开放性实验
    List<LabReservation> getNowLabReservationList();

    //√
    // 28 显示所有开放性实验
    List<ReservationItem> getAllLabReservationList();

    // 29 显示已选的开放性实验
    List<ReservationItem> getSelectedLabReservation(String student_id);


    // 30 ToDo 选择开放性实验加入
    Integer selectLabReservation(Long reservation_id,String student_id);

    // 31 ToDo 选择开放性实验退出
    Integer quitLabReservation(Long reservation_id,String student_id);

    //√
    // 32 初始化机房
    List<ComputerRoom> initComputerRoomList(List<ComputerRoom> computerRoomList);

    //
    List<CourseInfo> getCourseInfoList(List<ReservationItem> reservationItemList);

    //
    CourseInfo getCourseInfo(ReservationItem reservationItem);

}
